Line segment extraction device

ABSTRACT

Provided is a line segment extraction device capable of accurately and rapidly extracting a line segment. A pattern generating means relates an original image to cells of a cellular automaton to generate time-series configuration patterns. A primary detection means detects the movement of a cell in an active state and sets a primary flag according to the configuration patterns generated in time series. This generates time-series primary flag patterns. A secondary detection means detects a cell in which the direction of the primary flag and the direction of the movement thereof are matched to set a secondary flag according to the primary flag patterns generated in time series. A line segment detection means records a line segment marker on a cell in which the secondary flag in the opposite direction is generated, together with the direction. In this way, the line segment is extracted.

FIELD OF THE INVENTION

The present invention relates to a device for extracting line segmentscontained in picture data.

BACKGROUND ART

The inventor has already proposed a device for extracting line segmentscontained in pictures that utilizes a two dimensional cellular automaton(patent ref. 1, 2, 3). If these devices are used as a base, line segmentextraction can be performed more quickly and moreover more accuratelythan conventional line segment extraction that uses templates or pictureoperators.

CITATION LIST Patent Literature

Patent Literature 1: Japanese Laid-open Patent Application 1994-124348

Patent Literature 2: Japanese Laid-open Patent Application 1994-52315

Patent Literature 3: Japanese Laid-open Patent Application 1994-52306

SUMMARY OF THE INVENTION Technical Problem

As for the inventor's proposed technology mentioned above, althoughcompared with conventional technology they have the features of beingfaster and more accurate, there is noise contained in line segmentdetection. Further, the problem exists that depending on thecharacteristics of the picture to be processed, processing is notnecessarily fast.

Therefore, the purpose of this invention is to solve the problemsmentioned above, offering a line segment extraction device that makesprocessing both accurate and fast.

Solution to Problem

Following, each feature of the invention is shown independently.

(1)(3) The device for extracting line segments from a picture having aplurality of pixels disposed in multidimensional according to thepresent invention, the device comprises:

pattern generating means for calculating next state to be output fromcell of interest to surrounding cells based on the states input from thesurrounding cells and the present state of the cell of interest, saidcell of interest being selected in turn from cells corresponding to thepixels of picture each of which having active state or inactive stateaccording to value of corresponding pixel of picture and for calculatingnext state of the cell of interest based on present state of the cell ofinterest and states input from the surrounding cells to the cell ofinterest so that a configuration pattern indicating states of cells inmultidimensional is generated and recorded, wherein the patterngenerating means repeats the process of the generating and recording theconfiguration pattern;

primary detecting means for detecting movement with time of active cellalong with directional virtual line based on the configuration patternsat preceding and following timings (q−k, . . . , q−1, [[t]], q, q+1, . .. , q+1) of the reference time (q) recorded by the pattern generatingmeans so that primary flag pattern indicating positions of directionalprimary flags in multidimensional is generated and recorded by recordingthe directional primary flags which shows that the cells is part of thedirectional virtual line of given direction with respect to target cellswhich is cell on the directional virtual line at the reference time (q),wherein the primary detecting means repeats the process with varying thereference time (q) in order; and

line detecting means for detecting cell to which the directional primaryflag of one direction and another directional primary flag of oppositedirection to the one direction are recorded based on the primary flagpattern recorded by the primary detecting means so that mark indicatingpart of the line is recorded to said detected cell.

Lines can be extracted quickly and accurately by the device according tothe present invention.

(2)(6) The device for extracting line segments from a picture having aplurality of pixels disposed in multidimensional according to thepresent invention, the device comprises:

pattern generating means for calculating next state to be output fromcell of interest to surrounding cells based on the states input from thesurrounding cells and the present state of the cell of interest, saidcell of interest being selected in turn from cells corresponding to thepixels of picture each of which having active state or inactive stateaccording to value of corresponding pixel of picture and for calculatingnext state of the cell of interest based on present state of the cell ofinterest and states input from the surrounding cells to the cell ofinterest so that a configuration pattern indicating states of cells inmultidimensional is generated and recorded, wherein the patterngenerating means repeats the process of the generating and recording theconfiguration pattern;

primary detecting means for detecting movement with time of active cellalong with directional virtual line based on the configuration patternsat preceding and following timings (q−k, . . . , q−1, q, q+1, . . . ,q+1) of the reference time (q) recorded by the pattern generating meansso that primary flag pattern indicating positions of directional primaryflags in multidimensional is generated and recorded by recording thedirectional primary flags which shows that the cells is part of thedirectional virtual line of given direction with respect to target cellswhich is cell on the directional virtual line at the reference time (q),wherein the primary detecting means repeats the process with varying thereference time (q) in order;

secondary detecting means for detecting movement with time of theprimary flag along with the directional virtual line based on theprimary flag patterns at preceding and following timings (r−p, . . . ,r−1, r, r+1, . . . , r+u) of the reference time (r) recorded by theprimary detecting means, said secondary detecting means detecting saidmovement of the primary flag, direction of which is same with the givendirection of the directional virtual line, so that secondary flagpattern indicating positions of directional secondary flags inmultidimensional is generated and recorded by recording the directionalsecondary flags which shows that the cells is part of the directionalvirtual line of given direction with respect to target cells which iscell on the directional virtual line at the reference time (r), whereinthe secondary detecting means repeats the process with varying thereference time (r) in order; and

line detecting means for detecting cell to which the directionalsecondary flag of one direction and another directional secondary flagof opposite direction to the one direction are recorded based on thesecondary flag pattern recorded by the secondary detecting means so thatmark indicating part of the line is recorded to said detected cell.

Lines can be accurately extracted without noise influence by the deviceaccording to the present invention.

(4) The program for extracting line segments according to the presentinvention, wherein, at least one of said pattern generating means andsaid primary detecting means does not carry out the process when all ofthe cells of the picture at predetermined area around the cell ofinterest or the target cell are inactive states.

Both swiftness and accuracy are achieved by eliminating process fromwhich meaningful result may not be obtained.

(5) The program for extracting line segments according to the presentinvention, wherein the process by the pattern generating means, theprimary detecting means and line detecting means is repeated in turn,and further comprises means for halting the process when the relationbetween number of black cells of the picture and number of the cellswhich is detected as the part of the line at this time satisfiespredetermined condition.

The process can be automatically completed according to the number ofcurrently detected lines.

(7) The program for extracting line segments according to the presentinvention, wherein, at least one of said pattern generating means, saidprimary detecting means and said secondary detecting means does notcarry out the process when all of the cells of the picture atpredetermined area around the cell of interest or the target cell areinactive states.

Both swiftness and accuracy are achieved by eliminating process fromwhich meaning result may not be obtained.

(8) The program for extracting line segments according to the presentinvention, wherein the process by the pattern generating means, theprimary detecting means, the secondary detecting means and linedetecting means is repeated in turn, and further comprises means forhalting the process when the relation between number of black cells ofthe picture and number of the cells which is detected as the part of theline at this time satisfies predetermined condition.

The process can be automatically completed according to the number ofcurrently detected lines by the program according to the presentinvention.

(9) The program for extracting line segments according to the presentinvention, the program comprises:

noise cancelling means for eliminating the detected cell from the partof the line when the pixel of the picture corresponding to the detectedcell is not black.

Noise can be quickly eliminated by the program according to the presentinvention.

(10) The program for extracting line segments according to the presentinvention, wherein said line detecting means records the direction ofthe detected line.

Not only detecting lines but also direction of the lines can beobtained.

In the present invention, concept of “disposed in multidimensional”comprises a case of disposed in two dimensional plane or a case ofdisposed in multidimensional space such three dimensional space or fourdimensional space.

(11)(12) The device for extracting line segments from a picture having aplurality of pixels disposed in multidimensional according to thepresent invention, the device comprises:

pattern generating means for calculating next state to be output fromcell of interest to surrounding cells based on the states input from thesurrounding cells and the present state of the cell of interest, saidcell of interest being selected in turn from cells corresponding to thepixels of picture each of which having active state or inactive stateaccording to value of corresponding pixel of picture and for calculatingnext state of the cell of interest based on present state of the cell ofinterest and states input from the surrounding cells to the cell ofinterest so that a configuration pattern indicating states of cells inmultidimensional is generated and recorded, wherein the patterngenerating means repeats the process of the generating and recording theconfiguration pattern; and

line judging means for detecting movement of active cell or inactivecell based on series of the configuration patterns recorded by thepattern generating means so that the line is judged based on themovement of cell.

Lines can be accurately detected by the device according to the presentinvention.

(13)(14) The device for generating configuration pattern to be used forextracting line segments from a picture having a plurality of pixelsdisposed in multidimensional according to the present invention, thedevice comprises:

pattern generating means for calculating next state of a cell ofinterest based on present state of the cell of interest and states inputfrom the surrounding cells to the cell of interest, said cell ofinterest being selected in turn from cells corresponding to the pixelsof picture each of which having active state or inactive state accordingto value of corresponding pixel of picture so that a configurationpattern indicating states of cells in multidimensional is generated andrecorded, wherein the pattern generating means repeats the process ofthe generating and recording the configuration pattern;

wherein said pattern generating means generates the states input fromthe surrounding cells to the cell of interest based on the states inputfrom the surrounding cells and the present state of the cell ofinterest.

Time series configuration patterns which may be used for extracting thelines can be generated.

“Pattern generation method” is means for generating a configurationpattern. It corresponds to Step S4 of FIG. 11 a in the embodiment.

“Primary detecting means” is means for detecting the movement of theactive or inactive cell based on the series of the configurationpatterns. It corresponds to Step S5 of FIG. 11 a.

“Secondary detecting means” is means for detecting the movement of thecell having the primary flag or not having the primary flag based on theseries of the primary flag patterns. It corresponds to Step S6 of FIG.11 a.

“Line segment detecting means” is means for detecting the line segmentdirectly from the configuration pattern or based on the primary flag orsecondary flag obtained from the configuration pattern. It correspondsto Step S7 of FIG. 11 a in the embodiment.

“Halting means” is means for halting the process according to thedetecting situation of the flag or the line segment. It corresponds toStep S8 of FIG. 11 b.

“Noise eliminating means” is means for eliminating the component whichseems to be noise. It corresponds to Step S10 of FIG. 11 b.

“Line judging means” is means for detecting the line segment directlyfrom the configuration pattern or based on the flag etc. obtained fromthe configuration pattern. It corresponds to the primary detectingmeans, secondary detecting means, lien segment detecting means and linedetecting means in the embodiment.

“Cellular automaton” means a model that determines the states of anarray of cells where the state of each cell at time t is determinedbased on at least the state of the cell in question and the states ofthe surrounding cells at previous timing.

For example, as shown in the embodiment, the state of each cell at timet may be determined based on, at time t−1, the state of the cell inquestion and the state of the input received from the surrounding cells.Here, as for the input received from the surrounding cells, it isequivalent to the output when viewed from the perspective of eachsurrounding cell. As for each cell (the cell in question), the state ofthe output toward other cells is determined in the following manner:based on the state of the input that the cell in question has receivedfrom the other cells at time t−1, and the present state of the cell inquestion at time t−1, the state that should be output at time t to cellsother than the cell in question is calculated.

Thus, as shown in the embodiments, in order to determine the state ofthe cell of interest at time t, the inputs from the surrounding cells attime t−1 are used and in order to determine the states of the inputsfrom the surrounding cells, the states of the surrounding cells areused. Therefore, in the embodiments, the state of the cell of interestat time t is determined, though indirectly, based on the state of thecell of interest and the states of the surrounding cells at time t−1.

The above-mentioned method shown in the embodiment has been originallydesigned by the inventor. It has been classified in the specification asa type of cellular automaton.

“Configuration pattern” means pattern (such as one dimension array, twodimensional array or multi-dimensional array) generated by the abovementioned automaton.

Concept of “program” includes not only a program that can be directlyexecuted by the CPU, but also a program in the form of source code, aprogram that has been compressed, a program that has been encrypted, andso on.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1. A functional block diagram of the a line segment detectiondevice embodying a present invention.

FIG. 2. FIG. 2A shows an original picture. FIG. 2B shows input signalsfrom the surrounding cells.

FIG. 3 a. Configuration pattern (original picture) and primary flagpattern PF at time t=0.

FIG. 3 b. Secondary flag pattern SF and line segment marker pattern attime t=0.

FIG. 3 c. Configuration pattern and primary flag pattern PF at time t=1.

FIG. 3 d. Secondary flag pattern SF and line segment marker pattern attime t=1.

FIG. 3 e. Configuration pattern and primary flag pattern PF at time t=2.

FIG. 3 f. Secondary flag pattern SF and line segment marker pattern attime t=2.

FIG. 3 g. Configuration pattern and primary flag pattern PF at time t=3.

FIG. 3 h. Secondary flag pattern SF and line segment marker pattern attime t=3.

FIG. 3 i. Configuration pattern and primary flag pattern PF at time t=4.

FIG. 3 j. Secondary flag pattern SF and line segment marker pattern attime t=4.

FIG. 3 k. Configuration pattern and primary flag pattern PF at time t=5.

FIG. 3 l. Secondary flag pattern SF and line segment marker pattern attime t=5.

FIG. 3 m. Configuration pattern and primary flag pattern PF at time t=6.

FIG. 3 n. Secondary flag pattern SF and line segment marker pattern attime t=6.

FIG. 3 o. Configuration pattern and primary flag pattern PF at time t=7.

FIG. 3 p. Secondary flag pattern SF and line segment marker pattern attime t=7.

FIG. 3 q. Configuration pattern and primary flag pattern PF at time t=8.

FIG. 3 r. Secondary flag pattern SF and line marker pattern at time t=8.

FIG. 3 s. Configuration pattern and primary flag pattern PF at time t=9.

FIG. 3 t. Secondary flag pattern SF and line segment marker pattern attime t=9.

FIG. 3 u. Configuration pattern and primary flag pattern PF at timet=10.

FIG. 3 v. Secondary flag pattern SF and line segment marker pattern attime t=10.

FIG. 4. Explains the detection process of primary flags.

FIG. 5. Explains an example of the primary flags recorded.

FIG. 6. Explains the detection process of secondary flags.

FIG. 7. Explains the detection process of secondary flags.

FIG. 8. Explains the example of the secondary flags recorded.

FIG. 9. Explains the detection process of line segment marker flags.

FIG. 10. The hardware configuration of an embodiment of the line segmentextraction device being executed via a CPU.

FIG. 11 a. Flow chart of the line extraction program.

FIG. 11 b. Flow chart of the line extraction program.

FIG. 12. Flow chart of the generation of configuration patterns.

FIG. 13. Explains process omission depending on the original picture.

FIG. 14. Calculation of the output signal to the surrounding cells.

FIG. 15. Shows the contents of the buffer where output to surroundingcells is temporarily recorded.

FIG. 16. Shows the contents of the buffer where input from surroundingcells is temporarily recorded.

FIG. 17. Flow chart of the generation of primary flag pattern PF.

FIG. 18. Flow chart of the generation of primary flags concerning thetop to bottom virtual lines.

FIG. 19. Flow chart to generate secondary flag patterns SF.

FIG. 20. Flow chart of the generation of secondary flags concerning topto bottom virtual lines.

FIG. 21. Shows another example of secondary flag detection.

FIG. 22. As an example of the embodiment of this invention, shows theresults of a line segment extracted via the line segment extractionprogram.

FIG. 23. As an example of the embodiment of this invention, shows theresults of a line segment extracted via the line segment extractionprogram.

FIG. 24. As an example of the embodiment of this invention, shows theresults of a line segment extracted via the line segment extractionprogram.

FIG. 25. As an example of the embodiment of this invention, shows theresults of a line segment extracted via the line segment extractionprogram.

FIG. 26. Shows detailed results of line segment extraction.

DESCRIPTION OF EMBODIMENTS 1. Overall Structure

FIG. 1 shows a functional block diagram of the line extraction device ofan embodiment according to the present invention. Pattern generationmeans 2 receives an original two-dimensional binary picture ORG to beprocessed. For example, shown in FIG. 2A, the original picture ORG is abinary picture of width I and of height J. Each pixel shown as “1”represents a black pixel and “0” represents a white pixel. In patterngeneration block 2 at each pixel, “1” represents active state while “0”represents inactive state.

(1) Generation of the Configuration Pattern

Pattern generation block 2 determines the next state of each cell (acell corresponds to a pixel) respectively, according to the cellularautomaton. The next state, i.e., a⁺¹(i, j) is determined using thecurrent state of the said cell of interest a^(t)(i, j) and the inputstates b^(t)(i, j)(m, n) from the surrounding cells (e.g. eight cellssurrounding the cell of interest). (see FIG. 2B) i and j represent theaddress of the cell in the picture.

It is clear by the Figure that b^(t)(i, j)(0, −1) is an input state fromthe surrounding cell above adjacent to the cell of interest, b^(t)(i,j)(1, −1) is an input state from the surrounding cell right aboveadjacent to the cell of interest, b^(t)(i, j)(−1, −1) is an input statefrom the surrounding cell left bottom adjacent to the cell of interest.It will be described later how input state b^(t)(i,j)(m,n) from thesurrounding cell is determined.

Pattern generation means 2 determines whether next state of each cell is“active” or “inactive” and generates pattern A^(t+1)(configurationpattern) in the next timing. The generated configuration pattern A^(t+1)is recorded in record section 10.

In the above processing, pattern generation means 2 determines nextoutput c^(t+1)(i,j)(m,n), which is input b^(t+1)(i,j)(−m,−n) of asurrounding cell, based on the current state of the cell of interesta^(t)(i,j) and the input from the surrounding cell b^(t)(i,j)(m,n).

Pattern generation means 2 again generates and stores the nextconfiguration pattern A^(t+2) based on the generated configurationpattern A^(t+1) using the same method as written in the abovedescription. Therefore, the storing part 10 stores the configurationpatterns, A⁰, A¹, A² . . . as shown in the top of FIGS. 3 a, 3 c, 3 e .. . 3 u, respectively. In FIG. 3, black parts are “active” cells. A⁰denotes the original picture.

(2) Generation of Primary Flag Pattern

Primary detection means 4 detects the movement of the “active state”cell along the virtual line with a prescribed direction as time elapsesusing a predetermined number of patterns (from configuration patternA^(q−2) to A^(q+2)) before and after configuration pattern A^(q) atprescribed time q recorded in record section 10, and sets primarydetection flags for detecting the line at each position of the cell ofinterest.

The above process is depicted in FIG. 4. FIG. 4C shows 5×5 cells whosecenter is the cell of interest of configuration pattern A^(q) at thegiven time q. A black cell implies that the cell is “active state”.FIGS. 4A and 4B show the cells of configuration pattern A^(q−2) at thetime q−2 which is two time points before the given time q, andconfiguration pattern A^(q−1) at time q−1 which is one time point beforethe given time q, respectively. FIGS. 4D and 4E show configurationpattern A^(q+1) at time q+1, which is one time point after the giventime t and configuration pattern A^(q+2) at time q+2 which is two timepoints after the given time t, respectively.

As shown in FIGS. 4A through 4E, primary detection means 4 detects the“active state” that moves along virtual line IL extending from the upperleft to the bottom right. That is to say, regarding A^(q−2), A^(q−2),A^(q), A^(q+1) and A^(q+2) respectively, it is determined whether or notthe conditions in which the black parts in FIGS. 4A-4E are in “activestate” are satisfied. In this embodiment, in FIGS. 4A through 4E, whenmore than three cells out of five cells meet the conditions, primarydetection means 4 assumes that the cell of interest (center cell in FIG.4C) constitutes a part of virtual line IL. Primary detection means 4sets a primary flag in cells corresponding to the cell of interest(center cell in FIG. 4C) of the area for storing primary flags(corresponding to the cell in column i, row j). Further, this primaryflag pf not only shows that the cell of interest is determined as a partof virtual line IL, but also shows the direction of the virtual line ILas shown in FIG. 5.

In the above description, the virtual line, which extends from the upperleft to the bottom right, is described. The other eight directions; fromthe top to bottom, from the upper right to the bottom left, from rightto left, from the bottom right to the upper left, from the bottom totop, from the bottom left to the upper right, from left to right, andfrom the upper left to the bottom right, are also checked and flags areset.

Primary flag detection means 4 performs the detection proceduredescribed in the above paragraphs through all the cells (each cell istreated as the cell of interest in order) in the picture. Thus primaryflag patterns PF^(t) are stored in the area for storing primary flags.

As described in the above description, primary detection means 4calculates the primary flag patterns and stores them while shiftingpredetermined time q. Thus, the primary flag patterns of each time arerecorded in record section 10. The middle and bottom of FIGS. 3 a, 3 c,3 e . . . 3 u show the primary flag patterns obtained from theconfiguration patterns shown in the top of the same figures. Note thatbecause of the restriction of the page size of this document, theprimary flag patterns of top to bottom, left to right, top left tobottom right and bottom left to top right flags are shown in the middlesections of the figures. And the primary flag patterns of bottom to top,right to left, bottom right to top left and top right to bottom leftflags are shown in the lower sections of the figures.

(3) Generation of Secondary Flag Patterns

Next, secondary detection means 6 in FIG. 1 detects the movement overtime of cell which is set the primary flags along the virtual line witha specified direction using the primary flag pattern PF^(r) at time rand the primary flag patterns PF^(r−2) to PF^(r+2) at predeterminedtiming before and after time r and sets the secondary flags fordetecting the line elements at each position of the cell of interest.

This procedure is similar to that of the primary flag. When it isassumed to be a part of a line, the secondary flag is stored in the areafor storing secondary flags. As shown in FIG. 6, a secondary flag is setonly when the directions of the primary flag and of the primary flag'smovement (the direction of the virtual line) correspond. Note that thissecondary flag sf not only shows that the cell is determined to be apart of virtual line IL, but also shows the direction of virtual line ILas shown in FIG. 8. This is the same with the primary flag. Further, thesecondary flag is not set if the direction of the primary flags'movement doesn't correspond to the direction of the primary flag, evenif movement of the primary flags is detected. This is shown in FIG. 7.

Secondary detection means 6 performs the procedure of calculating andstoring secondary flags as described in the above description, whilemoving prescribed time t. In record section 10, the secondary flagsgenerated for each time point are stored as one secondary flag patternSF. Furthermore, patterns are generated at each time point concerningthe primary flag pattern due to the necessity of the detection of itstemporal movement. However, regarding the secondary flag pattern, thereis no necessity of detection of its temporal movement, so secondaryflags, each of which is generated at each time point, may be gatheredand stored as one pattern.

In the top and the middle of FIGS. 3 b, 3 d, 3 f, . . . , 3 v, secondaryflag patterns SF, which are obtained based on primary flag patterns ofFIGS. 3 a, 3 c, 3 e, . . . , 3 u, are shown. Note that, forconvenience's sake, these figures show only flags that are newlygenerated according to that time point.

(4) Line Detection

Next, line detection means 8 detects cells in which a secondary flagwhich is of the opposite direction of the same cell, is set, based onstored secondary flag pattern SF. Thus, a line marker is stored in thearea for storing line markers. For example, if secondary flag pattern SFis like FIG. 9A, as shown in FIG. 9B, line marker rl is stored only inthe cells which have secondary flags of the direction from the bottomright to the upper left and from the upper left to the bottom right.Note that line detection means 8 performs the same detection regardingcells which have secondary flags of the direction from bottom to top andtop to bottom, the cells which have secondary flags of the directionfrom the bottom left to the upper right and from the upper right to thebottom left, and the cells which have secondary flags of the directionfrom left to right and from right to left. Further, line marker rl alsoshows line direction as shown in FIG. 9B.

Thus, line pattern RL is generated, and is output as a line extractionresult. The bottom of FIGS. 3 b, 3 d, 3 f, . . . , 3 v shows extractedline marker patterns. As is apparent from FIG. 3 v, the original image'sline segment (configuration pattern A⁰) of FIG. 3 a is extractedproperly.

2. Hardware Configuration

FIG. 10 shows a hardware structure of the line extraction device shownin FIG. 1 with a CPU. Memory 12, display 14, keyboard and mouse 16, harddisk 20 and CD-ROM drive 22 are connected to the CPU 18. Memory 12 isused as buffers or as working area. Hard disk 20 stores an operatingsystem (OS) 24, line extraction program 26 and others. The lineextraction program 26 cooperates with the OS 24 and displays itsfunctions. These programs are installed on hard disk 20 through CD-ROMdrive 22 from CD-ROM 28.

3. Line Extraction Program

FIG. 11 shows the flow chart of line segment extraction program 26,which is stored on Hard Disk 20. CPU 18 performs the above (1)generation of the configuration patterns, (2) generation of the primaryflag patterns, (3) generation of the secondary flag patterns, and (4)generation of the line marker patterns.

At first, CPU 18 set 0 to t (Step S1). Next, an original image is storedon the Hard Disk 20, and is binarized (Step S2). And then, CPU 18records the binarized original image and records it in the configurationbuffer (the area placed in memory 12) as configuration pattern A⁰ attime t=0.

(1) Generation of Configuration Pattern A.

Next, CPU 18 generates configuration pattern A¹ at time t=1 and storesit in the configuration buffer (Step S4). FIG. 12 shows the preciseconfiguration pattern generation process.

CPU 18, at first, sets i=2 and j=2 (Steps S41 and S42). Then, the cellat row 2, column 2 is defined as the cell of interest (Step S43). Thisis shown as the hatched cell in FIG. 13. CPU 18 checks whether all the5×5 cells whose center is the cell of interest are in “inactive” stateor not in configuration pattern A⁰(the binarized original image) (StepS44). That is, whether all of a⁰(0, 0), a⁰(1, 0), a⁰(2, 0), a⁰(3, 0),a⁰(4, 0), a⁰(0, 1), a⁰(1, 1) a⁰(2, 4), a⁰(3, 4), a⁰(4, 4) are in“inactive” states or not. Note that the process was begun from i=2 andj=2 because the process cannot be performed with the coordinates i<2 orj<2 in Step S44.

When all of the states of a⁰(0, 0), a⁰(1, 0), a⁰(2, 0), a⁰(3, 0), a⁰(4,0), a⁰(0, 1), a⁰(1, 1) . . . a⁰(2, 4), a⁰(3, 4), a⁰(4, 4) inconfiguration pattern A⁰ are “inactive”, processing for the cell ofinterest is not performed, and it proceeds to the next cell. That is, ifa cell of the binarized original image satisfies such conditions, theprocesses of Step S45 and S46 are not performed in each following timepoint.

On the other hand, if any cell is in the “active” state, the procedureto determine the next state a¹(2, 2) of the cell of interest isperformed (Step S45).

CPU 18 determines the next state a¹(2, 2) according to Table 1.

TABLE 1 Determine the next state Next state a^(t+1) of the cell ofNumber of “inhibitions” in Present state a^(t) interest to be b^(t) fromsurrounding cells of the cell of interest determined Greater than orequal to Inactive Active threshold S Active Inactive Smaller thanInactive Inactive threshold S Active Active

Input from the surrounding cells is shown in FIG. 2B. The input form thesurrounding cells can be one of two values. One is the “inhibited” statesignal represented by −1, the other is the “excited” state signalrepresented by 1. Note that the inputs from the surrounding cells attime t=0 are all set to the “inhibited” state.

It is clear that, as shown in Table 1, when the number of “inhibited”state signals in the signals from the surrounding cells, b⁰(2, 2)(0,−1), b⁰(2, 2)(1, −1), b⁰(2, 2)(1, 0), b⁰(2, 2)(1, 1), b⁰(2, 2)(0, 1),b⁰(2, 2)(−1, 1), b⁰(2, 2)(−1, 0) and b⁰(2, 2)(−1, 1) is greater than orequal to threshold S (e.g. 4), the state of the cell of interest a⁰(2,2) is changed and becomes the next state a¹(2, 2). That is, the“inactive” state is changed to the “active” state, and the “active”state is changed to the “inactive” state. When the number of“inhibition” state signals is less than threshold S from the inputstates from the surrounding cells, the state of the cell of interesta⁰(2, 2) maintains for the next state a¹(2, 2).

CPU 18 records the next state a¹(2, 2) of the determined pixel ofinterest in the configuration buffer for the time t=1.

CPU 18 determines the content which is output to time t=1 concerningeight surrounding cells, i.e., the cell at the top, the cell at thebottom, the cell at the left, the cell at the right, the cell at the topright, the cell at the top left, the cell at the bottom right and thecell at the bottom left (Step S46). CPU 18 performs this procedureaccording to Table 2.

TABLE 2 Determine next output to the surrounding cells Next outputc^(t+1) b^(t) from Present state a^(t) to the surrounding thesurrounding cells of the cell of interest cell Inhibition ActiveExcitation Inactive Inhibition Excitation Active Inhibition InactiveExcitation

For example, as shown in FIG. 14, next output c^(t+1)(i, j)(1, −1) fromthe cell of interest to the surrounding cell adjacent to the right topof the cell of interest at the position row i, column j is determined byusing the present input state b^(t)(i, j)(1, −1) from the cell at thetop right and the present state of the cell of interest a^(t)(i,j).Outputs of other cells are determined with the same criteria. CPU 18records the next outputs determined by above mentioned process in bufferC^(t+1) (FIG. 15).

Next, CPU 18 increments j by 1, and using the cell at i=2, j=3 as thecell of interest (Step S43), it carries out Steps S44 and following.From this, the next state a¹(2,3) of the cell at i=2, j=3 is determined,and is recorded in the configuration buffer of t=1. It is also recordedin the buffer of FIG. 15, where the next output for the surroundingcells is calculated.

Repeating the above, when repetition reaches the rightmost cell(precisely, the third cell from the rightmost), CPU 18 increments iby 1. From this, the next line's cell becomes the cell of interest.Following this, by repeating this process, the above-mentioned processconcerning all of the cells of the configuration pattern for t=0 iscompleted.

CPU 18 generates input buffer B^(t+1) as shown in FIG. 16 (Step S47)based on the contents of output buffer C^(t+1). Furthermore, inputbuffer B^(t+1) has centered, generated and corrected the cells thatreceive input for the contents of output buffer C^(t+1), in which outputcells have been centered and described.

In the above manner, configuration pattern A¹ is formed. Configurationpattern A⁰(the binarized original picture) is shown in the upper sectionof FIG. 3 a, and configuration pattern A¹ is shown in the upper sectionof FIG. 3 c.

Next, CPU 18 generates a primary flag pattern based on the configurationpatterns that have accumulated as time elapses (FIG. 11 a Step S5). Theprimary flag pattern, as explained in FIG. 4, is formed provided that 3or more of the conditions in FIGS. 4A˜4E are fulfilled. Thus, if atleast three configuration patterns have not accumulated, the primaryflag will not be generated. Primary flags are not generated in themiddle and lower sections of FIG. 3 a for this reason.

Next, CPU 18 generates a secondary flag pattern based on the primaryflag patterns that have accumulated as time elapses (FIG. 11 a Step S6).The secondary flag pattern, as explained in FIG. 6, will be formedprovided that 3 or more of the conditions in FIGS. 6A˜6E are fulfilled.Thus, if at least three primary flag patterns have not accumulated, thesecondary flag will not be formed. Secondary flags are not generated inthe upper and middle sections of FIG. 3 b for this reason.

Next, CPU 18 detects line segments based on the secondary flag pattern(FIG. 11 a Step S7). In a stage where secondary flags are not generated,line segments will not be detected. Line segment markers have not beengenerated in the lower section of FIG. 3 b for this reason.

In the above manner, when processing concerning time t=0 is finished,CPU 18 passes through Step S8 (this process will be explained later),proceeds to Step S9, and adds 1 to t. That is, it makes t=1.

CPU 18 again carries out Step S4 and the following processes with t=1.When generating configuration patterns, the next state a² of each cellof interest is determined based on table 1. Then, the next state c²output from each cell of interest to the surrounding cells is determinedbased on table 2. At this time, based on buffer B¹ generated in Step S47of FIG. 12, CPU 18 references input b¹ from the surrounding cells.

Configuration pattern A² at time t=2 is shown in the upper section ofFIG. 3 e.

When the processes of FIGS. 11 a and 11 b are repeated, for each timethat t has increased, configurations patterns A⁰A¹A² are generated andrecorded in a buffer in succession.

(2) Generation of Primary Flag Pattern PF

While CPU 18 generates and records configuration patterns A⁰A¹A², . . ., it carries out the generation of the primary flag pattern (FIG. 11 aStep 5). The primary flag pattern generation process is shown in FIG.17.

CPU 18 determines standard time point q for detecting primary flags. Inthe embodiment diagram, a time point where the present t has beendecremented by 2 is used as standard time point q. First, CPU 18determines whether or not the cell of interest at standard time point qcan be presumed to exist as a part of a downward facing virtual line(Step S51).

As shown in FIG. 17 Step S51, CPU 18 carries out a determinationconcerning configuration pattern A^(q−2)A^(q−1)A^(q)A^(q+1)A^(q+2) fromtime point q−2, which is 2 time points before standard time point q, totime point q+2, which is 2 time points after standard time point q. Theflowchart of the presumption-process of downward virtual lines is shownin FIG. 18.

First, CPU 18 sets the cell at position i=2, j=2 in configurationpattern A^(q) of standard time point q as the cell of interest (StepS513). Next, it determines whether a 5×5 area of cells centering thecell of interest in the binarized original picture are all “inactive”(Step S514). If they are all inactive, as there is little possibilitythat processing will yield meaningful results, it does not carry out theprocess concerning this cell of interest (identical with FIG. 12 StepS44).

If any cells are “active”, even one, CPU 18 changes m one by one from −2to 2 and carries out Steps S517 and S518. When m=−2, concerningconfiguration pattern A^(q−2) (that is, the pattern two points beforestandard time point q) in Step S517, it determines whether the celllocated at column i, row j−2 (that is, the cell turned to black in q−2of FIG. 17 Step S51) is “active” or not. If it is “active”, 1 is addedto COUNT (Step S518). For the above process, after changing m,concerning configuration pattern A^(q−1)(that is, the pattern one stepbefore standard time point q), it is determined whether the cell locatedat column i, row j−1(that is, the cell turned to black in q−1 of FIG. 17Step S51) is “active” or not, . . . , and concerning configurationpattern A^(q+2) (that is, the pattern 2 steps after standard time pointq), it is determined whether the cell located at column i, row j+2 (thatis, the cell turned to black in q+2 of FIG. 17 Step S51) is “active” ornot, then the number determined as “active” is recorded in COUNT.

If the number of COUNT is greater than or equal to the prescribedthreshold value (here being 3), CPU 18 records a top-to-bottom primaryflag pf in the cell of interest of the primary flag buffer of time pointq (Step S521). In this way, the direction of the virtual line of primaryflag pf is also recorded. Primary flag pf is, for example, recorded inprimary flag buffer PF^(q) as in FIG. 5 (though in FIG. 5, thedown-right primary flag is shown).

In the above manner, when the process concerning one cell of interest iscompleted, the same process is carried out using the next cell as thecell of interest. Then, this is repeated until the processing concerningall of the cells is done, and the primary flag detection of thetop-to-bottom virtual line is completed.

In FIG. 17 Steps S52-S58, the processing means is identical with StepS51; only the direction of the virtual line differs.

In the above manner, primary flag pattern PF^(q) is generated. Asprocesses of FIG. 11 a Steps S4-S9 are repeated and t is incremented,the time-sequential flag patterns PF^(q) PF^(q+1) PF^(q+2) . . . aregenerated and recorded. One series of primary flag patterns is shown inthe middle and lower sections of FIG. 3 e and FIGS. 3 g˜3 u.

Still, in the above, it is assumed that for one time point, there willbe one cell that must be detected as “active”. If for one time pointmore than one cell is set up as a detection object, if any cells are“active”, processing may proceed in a manner that fulfills theseconditions. For example, in q−2 and q+2, the cells in FIG. 17 that showan X can also be used as detection object cells. In this way, it ispossible to detect lines that have a slight difference in slope.

(3) Generation of Secondary Flag Pattern SF

In the manner mentioned above, while CPU 18 generates and recordsprimary flag patterns PF²PF³ PF⁴ . . . it carries out the generation ofsecondary flag pattern SF (FIG. 11 a Step S6).

CPU 18 determines standard time rq for the purpose of secondary flagdetection. In this embodiment, a time point where the present time t hasbeen decreased by 4 is used as standard time point r. CPU 18 firstdetermines whether or not the cell of interest at standard time point rcan be presumed to be a part of a top-to-bottom virtual line (Step S61).Likewise, it determines whether or not it can be presumed to be part ofvirtual lines facing in other directions (Steps S62-68).

A flowchart of the generation process of secondary flag pattern SF isshown in FIG. 19. From FIG. 19, clearly, the detection method ofsecondary flag pattern sf is the same as the detection method of primaryflag pattern pf. However, in the detection of secondary flag pattern sf,it differs in the point that it determines whether or not the directionof the primary flag and the direction of the virtual line are in accord.

In FIG. 20, in the flowchart for the presumption process for downwardvirtual lines, a point of difference with primary flag detection (FIG.18) is shown. In Step S617 a, it is determined whether or not a primaryflag is present in the cell at column i, row j+m of PF^(r−m). If aprimary flag is present, it is next determined whether or not the flag'sdirection and the imaginary line's direction (here top-to-bottom) are inaccord (Step S617 b). If they are in accord, since the conditions arefulfilled, COUNT is increased by 1(Step S618). Thus, in the detection ofsecondary flag sf, even if a flag is present in the detection objectcell, if its direction is not in accord with the direction of thevirtual line, there will be no secondary flag present (Refer to theexample of FIG. 7).

When COUNT exceeds the threshold value (here 3), CPU 18 records atop-to-bottom secondary flag in the cell of interest of the secondaryflag buffer (this corresponds to FIG. 18 Step S521). Still, though aprimary flag buffer has been prepared for each respective standard timepoint in the time sequence, the secondary flags generated in eachstandard time point can be recorded sequentially in a single secondaryflag buffer.

In the above, an explanation has been given concerning the detection oftop-to-bottom secondary flags. The detection process concerningsecondary flags facing in other directions is identical.

Changes in secondary flag pattern SF recorded in the secondary flagbuffer are shown in the upper and middle sections of FIG. 3 j and FIGS.3 l˜3 v. Furthermore, for convenience's sake, only secondary flags thatwere newly generated at the time in question are shown in these figures.

(4) Line Segment Marker Pattern Generation

As mentioned above, while CPU 18 generates secondary flag sf as timeelapses, it continues to modify secondary flag pattern SF, and carriesout the line segment marker pattern detection process (FIG. 11 a StepS7).

CPU 18, concerning each pixel of recorded secondary flag pattern SF,searches to see if a secondary flag facing in the opposite direction ispresent. For example, in FIG. 9A, there are 5 cells where the “bottomright to top left” and “top left to bottom right” secondary flags arerecorded. When CPU 18 detects this, it records line segment marker rlconcerning the cell in question of the line segment marker patternbuffer (see FIG. 9B). Still, in this embodiment, line segment marker rlwill be recorded containing the line segment's direction as well. Inthis way, it can be made certain whether or not a detected line segmentexists as part of a line of a certain direction.

In the above manner, as time elapses, line segment markers are recordedin the line segment marker pattern buffer, and the line segment patternis generated.

(5) Stopping the Process

While repeating the above process, CPU 18 brings the process tocompletion depending on its own judgment. This process belongs to StepS8. In this embodiment, from time t=0 t is increased, and the judgmentin Step S8 is carried out according to the time points following that inwhich the line segment marker was first recorded.

In Step S8, the number of newly generated line segment markers in thecurrent time point is calculated. If this number is smaller than theprescribed ratio (for example, 1%, etc.) concerning the number of activecells contained in configuration patter A⁰(that is, the number of blackpixels in the binarized original picture), the process is brought tocompletion. This is because when there are few newly generated linesegment markers, it can be assumed that for the most part, detection ofany necessary lines has been completed.

Furthermore, even in the situation that the above-mentioned conditionsare not fulfilled, processing is brought to completion in the conditionswhere the previously established number of times of t have been carriedout.

(6) Noise Elimination

When the conditions to stop processing are fulfilled, CPU 18 carries outthe noise elimination process for recorded line segment marker patternRL (Step S10). In this embodiment, concerning each cell where a linesegment marker rl of line segment marker pattern RL has been recorded,it is determined whether or not the cells in the correspondingconfiguration pattern A⁰ are “active”. If “active”, the line segmentmarker rl of the cell in line segment marker pattern RL is left as-is.If a cell in corresponding configuration pattern A⁰ is “inactive”, theline segment marker rl in the cell in question in line segment markerpattern RL is deleted. In this case, the reason is that since the pixelin the binarized original picture that corresponds to the line segmentmarker in question is not black, there is a high possibility that it isnoise.

(7) Displaying Results

While recording the noise-removed line segment marker pattern to HardDisk 20, CPU 18 creates a display on Display 14 (Step S11). At thistime, CPU 18, for example, may create a display and modify colorsaccording to the directions of the line segment markers.

4. Other Embodiments

(1) In the above embodiments, line segment marker detection is carriedout based on the secondary flags. It is done in this manner for thepurpose of suppressing noise generation. However, depending on the typeof picture (pictures with many vertical and horizontal lines, etc.),without carrying out secondary flag detection, line segment markerdetection may be carried out based on the primary flags. Also, tertiaryflags (flags detected based on secondary flags), etc. may be preparedand line segment marker detection carried out based on these.

(2) In the above embodiments, 5 time points' patterns are used for thepurpose of detecting primary flags and secondary flags. However,detection may also be carried out based on 4 or less, or 6 or morepatterns. Also, depending on the primary flags and secondary flags, thenumber of patterns used for detection may change. For example, primaryflags may be detected using 5 time points' configuration patterns, andsecondary flags may be detected using 3 time points' primary flagpatterns. Depending on the type of picture, working in this way,processing can be sped up while suppressing noise.

(3) In the above embodiments, in each processing step, it is determinedwhether or not the cells surrounding the pixel of interest in thebinarized original picture are all “inactive” or not, and processing isomitted (Step S44 of FIG. 12, etc.). However, before all processing,cells that fulfill the above mentioned conditions may be removed fromthe cell of interest.

(4) In the above embodiments, as shown in FIG. 17, there is onedetection-object cell for each of 5 respective time points. However, itcan also be done in a manner where multiple detection-object cells areset up, still with 5 time points, and in each time point, if all of thedetection-object cells are not “active”, conditions are not satisfied(or, it may also be set so that if the prescribed number or greater ofdetection object cells are not “active”, conditions are not satisfied).Thus, if the number of time points that satisfies the conditions meetsor exceeds the threshold value, a primary flag will be set in multiplecells (a flag is set in the position of a detection object cell in thestandard time point). In this way, thick lines can be quickly detected.The same is true for secondary flags.

(5) In the above embodiments, the determination of secondary flags iscarried out as shown in FIG. 6. However, as shown in FIG. 21, in thenumber of cells of the surrounding area containing object cells (here9), if there are any primary flags where the directions match,conditions may be determined to be satisfied. Thus, if the time taken tosatisfy the conditions meets or exceeds the threshold value, secondaryflags will be set.

Especially, since primary flags shown in the early period are of highimportance in line segment detection, it is desirable to carry out linesegment detection in the manner mentioned above, if at all possible. Forexample, until t's prescribed time (for example, t=10), secondary flagsmay be detected via the method of FIG. 21, then on and after thatsecondary flags may be detected via the method of FIG. 6.

(6) In the above embodiment, the ratio of the number of black pixels inthe binarized original picture to the number of newly detected linesegment markers is used as the stop condition of Step S8. However, theslope of change of the number of newly detected line segment markers mayalso be used.

(7) In the above embodiments, line segment markers are being recordedconcerning cells where secondary flags of opposite directions have beenset. However, line segment markers may also be set concerning cellswhere a secondary flag of one direction has been set.

(8) In the above embodiments, line segment detection has been carriedout concerning a picture in two-dimensional space; however, line segmentdetection may be carried out in the same way concerning multidimensionalspace. For example, in three-dimensional space there come to be 26 cellssurrounding the cell of interest; the directions of virtual linesincrease to 24, but the basic processing contents are still the same.

(9) In the above embodiments, line segment detection was carried outusing the original picture's black parts as active state and white partsas inactive state, but the original picture's white parts may also beused as active state and black parts as inactive state.

(10) In the above embodiments, in each cell of the line segment markerpattern buffer, detected line segment markers are being recorded insuccession. Thus, the situation also arises that in one cell, linesegment markers of multiple directions are recorded. However, it mayalso be arranged so that for a cell where a line segment marker hasalready been recorded, line segment markers beyond that are notrecorded.

(11) In the above embodiments, it is set up so that the state of thecell of interest is determined by receiving input from 8 surroundingcells. However, the state of the cell of interest may also be determinedby looking only to a specific surrounding cell, or the state of the cellof interest may also be determined by looking to the input from anarbitrary number of cells.

(12) In the above embodiments, output concerning the surrounding cellsin question is being determined looking at one of the states of thesurrounding cells' output signals. However, another surrounding cell'sstate may also be considered.

(13) In the above embodiments, the next state of the cell of interest isbeing calculated based on the present state of the cell of interest andthe state of the input received from the surrounding cells, and theinput from the surrounding cells is determined based on the presentstate output by the cell of interest concerning the surrounding cell inquestion and the present state of the surrounding cell in question.

However, the input from the surrounding cells may be the present stateof the surrounding cell as is. That is, a conventional cellularautomaton may be used.

(14) In the above embodiments, FIG. 1's function has been realized usingsoftware, but part or all of it may also be realized using hardware.

5. Example

An example of the process for extracting line segments from picturesbeing carried out using the line extraction program of the abovementioned embodiment is shown in FIGS. 22˜25. FIG. 22A shows theoriginal picture, FIG. 22B the binarized original picture, and FIG. 22Cline segment extraction results. The same is also true for that in FIGS.23, 24, and 25. A personal computer using a Centrino™ Duo (clockfrequency 1.8 GHz) was used as the CPU. The processing of the linesegment extraction program was carried out following that in the aboveembodiments. However, in the secondary flag detection process, untilt=10, processing was carried out in the detection method shown in FIGS.21, and t=11 and following were carried out in the detection methodshown in FIG. 6.

In the upper section of FIG. 26, FIG. 24B's binarized picture isdisplayed again. The central left section shows a magnified section ofthis binarized picture. The central right section shows the results ofline segment detection carried out following the above embodiments withline segment markers corresponding to the aforementioned magnifiedsection. The lower section shows the central right section's linesegment markers, magnified. From the Figure of the lower section, linesegments' presence or absence is shown and their directions aredetected.

It should be understood from FIG. 25 that even extremely thin lines(lines with high spatial frequency) can be properly detected.

1. A device for extracting line segments from a picture having aplurality of pixels disposed in multidimensional comprising: patterngenerating means for calculating next state to be output from cell ofinterest to surrounding cells based on the status input from thesurrounding cells and the present state of the cell of interest, saidcell of interest being selected in turn from cells corresponding to thepixels of picture each of which having active state or inactive stateaccording to value of corresponding pixel of picture and for calculatingnext state of the cell of interest based on present state of the cell ofinterest and status input from the surrounding cells to the cell ofinterest so that a configuration pattern indicating status of cells inmultidimensional is generated and recorded, wherein the patterngenerating means repeats the process of the generating and recording theconfiguration pattern; primary detecting means for detecting movementwith time of active cell along with directional virtual line based onthe configuration patterns at preceding and following timings (q−k, . .. , q−1, g, q+1, . . . , q+1) of the reference time (q) recorded by thepattern generating means so that primary flag pattern indicatingpositions of directional primary flags in multidimensional is generatedand recorded by recording the directional primary flags which shows thatthe cells is part of the directional virtual line of given directionwith respect to target cells which is cell on the directional virtualline at the reference time (q), wherein the primary detecting meansrepeats the process with varying the reference time (q) in order; andline detecting means for detecting cell to which the directional primaryflag of one direction and another directional primary flag of oppositedirection to the one direction are recorded based on the primary flagpattern recorded by the primary detecting means so that mark indicatingpart of the line is recorded to said detected cell.
 2. A device forextracting line segments from a picture having a plurality of pixelsdisposed in multidimensional comprising: pattern generating means forcalculating next state to be output from cell of interest to surroundingcells based on the status input from the surrounding cells and thepresent state of the cell of interest, said cell of interest beingselected in turn from cells corresponding to the pixels of picture eachof which having active state or inactive state according to value ofcorresponding pixel of picture and for calculating next state of thecell of interest based on present state of the cell of interest andstatus input from the surrounding cells to the cell of interest so thata configuration pattern indicating status of cells in multidimensionalis generated and recorded, wherein the pattern generating means repeatsthe process of the generating and recording the configuration pattern;primary detecting means for detecting movement with time of active cellalong with directional virtual line based on the configuration patternsat preceding and following timings (q−k, . . . , q−1, q, q+1, . . . ,q+1) of the reference time (q) recorded by the pattern generating meansso that primary flag pattern indicating positions of directional primaryflags in multidimensional is generated and recorded by recording thedirectional primary flags which shows that the cells is part of thedirectional virtual line of given direction with respect to target cellswhich is cell on the directional virtual line at the reference time (q),wherein the primary detecting means repeats the process with varying thereference time (q) in order; secondary detecting means for detectingmovement with time of the primary flag along with the directionalvirtual line based on the primary flag patterns at preceding andfollowing timings (r−p, . . . , r−1, r, r+1, . . . , r+u) of thereference time (r) recorded by the primary detecting means, saidsecondary detecting means detecting said movement of the primary flag,direction of which is same with the given direction of the directionalvirtual line, so that secondary flag pattern indicating positions ofdirectional secondary flags in multidimensional is generated andrecorded by recording the directional secondary flags which shows thatthe cells is part of the directional virtual line of given directionwith respect to target cells which is cell on the directional virtualline at the reference time (r), wherein the secondary detecting meansrepeats the process with varying the reference time (r) in order; andline detecting means for detecting cell to which the directionalsecondary flag of one direction and another directional secondary flagof opposite direction to the one direction are recorded based on thesecondary flag pattern recorded by the secondary detecting means so thatmark indicating part of the line is recorded to said detected cell. 3.Computer-readable medium storing a program for extracting line segmentsfrom a picture having a plurality of pixels disposed inmultidimensional, said program comprising instructions for: a patterngenerating step for calculating next state to be output from cell ofinterest to surrounding cells based on the status input from thesurrounding cells and the present state of the cell of interest, saidcell of interest being selected in turn from cells corresponding to thepixels of picture each of which having active state or inactive stateaccording to value of corresponding pixel of picture and for calculatingnext state of the cell of interest based on present state of the cell ofinterest and status input from the surrounding cells to the cell ofinterest so that a configuration pattern indicating status of cells inmultidimensional is generated and recorded, wherein the patterngenerating means repeats the process of the generating and recording theconfiguration pattern; a primary detecting step for detecting movementwith time of active cell along with directional virtual line based onthe configuration patterns at preceding and following timings (q−k, . .. , q−1, q, q+1, . . . , q+1) of the reference time (q) recorded by thepattern generating step so that primary flag pattern indicatingpositions of directional primary flags in multidimensional is generatedand recorded by recording the directional primary flags which shows thatthe cells is part of the directional virtual line of given directionwith respect to target cells which is cell on the directional virtualline at the reference time (q), wherein the primary detecting meansrepeats the process with varying the reference time (q) in order; and aline detecting step for detecting cell to which the directional primaryflag of one direction and another directional primary flag of oppositedirection to the one direction are recorded based on the primary flagpattern recorded by the primary detecting step so that mark indicatingpart of the line is recorded to said detected cell.
 4. The program forextracting line segments in accordance with claim 3, wherein, in atleast one of said pattern generating step and said primary detectingstep the process is not carried out when all of the cells of the pictureat predetermined area around the cell of interest or the target cell areinactive status.
 5. The program for extracting line segments inaccordance with claim 3, wherein the process by the pattern generatingstep, the primary detecting step and line detecting step is repeated inturn, and further comprising instructions for halting the process whenthe relation between number of black cells of the picture and number ofthe cells which is detected as the part of the line at this timesatisfies predetermined condition.
 6. Computer-readable medium storing aprogram for extracting line segments from a picture having a pluralityof pixels disposed in multidimensional, said program comprisinginstructions for: a pattern generating step for calculating next stateto be output from cell of interest to surrounding cells based on thestatus input from the surrounding cells and the present state of thecell of interest, said cell of interest being selected in turn fromcells corresponding to the pixels of picture each of which having activestate or inactive state according to value of corresponding pixel ofpicture and for calculating next state of the cell of interest based onpresent state of the cell of interest and status input from thesurrounding cells to the cell of interest so that a configurationpattern indicating status of cells in multidimensional is generated andrecorded, wherein the pattern generating means repeats the process ofthe generating and recording the configuration pattern; a primarydetecting step for detecting movement with time of active cell alongwith directional virtual line based on the configuration patterns atpreceding and following timings (q−k, . . . , q−1, q, q+1, . . . , q+1)of the reference time (q) recorded by the pattern generating step sothat primary flag pattern indicating positions of directional primaryflags in multidimensional is generated and recorded by recording thedirectional primary flags which shows that the cells is part of thedirectional virtual line of given direction with respect to target cellswhich is cell on the directional virtual line at the reference time (q),wherein the primary detecting means repeats the process with varying thereference time (q) in order; a secondary detecting step for detectingmovement with time of the primary flag along with the directionalvirtual line based on the primary flag patterns at preceding andfollowing timings (r−p, . . . , r−1, r, r+1, . . . , r+u) of thereference time (r) recorded by the primary detecting step, saidsecondary detecting step detecting said movement of the primary flag,direction of which is same with the given direction of the directionalvirtual line, so that secondary flag pattern indicating positions ofdirectional secondary flags in multidimensional is generated andrecorded by recording the directional secondary flags which shows thatthe cells is part of the directional virtual line of given directionwith respect to target cells which is cell on the directional virtualline at the reference time (r), wherein the secondary detecting steprepeats the process with varying the reference time (r) in order; and aline detecting step for detecting cell to which the directionalsecondary flag of one direction and another directional secondary flagof opposite direction to the one direction are recorded based on thesecondary flag pattern recorded by the secondary detecting step so thatmark indicating part of the line is recorded to said detected cell. 7.The program for extracting line segments in accordance with claim 6,wherein, in at least one of said pattern generating step, said primarydetecting step and said secondary detecting step process is not carriedout when all of the cells of the picture at predetermined area aroundthe cell of interest or the target cell are inactive status.
 8. Theprogram for extracting line segments in accordance with claim 6, whereinthe process by the pattern generating step, the primary detecting step,the secondary detecting step and line detecting step is repeated inturn, and further comprising instructions for halting the process whenthe relation between number of black cells of the picture and number ofthe cells which is detected as the part of the line at this timesatisfies predetermined condition.
 9. The program for extracting linesegments in accordance with one of claims 3, further comprisinginstructions for: a noise cancelling step for eliminating the detectedcell from the part of the line when the pixel of the picturecorresponding to the detected cell is not black.
 10. The program forextracting line segments in accordance with one of claims 3, wherein, insaid line detecting step, the direction of the detected line isrecorded.
 11. A device for extracting line segments from a picturehaving a plurality of pixels disposed in multidimensional comprising:pattern generating means for calculating next state to be output fromcell of interest to surrounding cells based on the status input from thesurrounding cells and the present state of the cell of interest, saidcell of interest being selected in turn from cells corresponding to thepixels of picture each of which having active state or inactive stateaccording to value of corresponding pixel of picture and for calculatingnext state of the cell of interest based on present state of the cell ofinterest and status input from the surrounding cells to the cell ofinterest so that a configuration pattern indicating status of cells inmultidimensional is generated and recorded, wherein the patterngenerating means repeats the process of the generating and recording theconfiguration pattern; and line judging means for detecting movement ofactive cell or inactive cell based on series of the configurationpatterns recorded by the pattern generating means so that the line isjudged based on the movement of cell.
 12. Computer-readable mediumstoring a program for extracting line segments from a picture having aplurality of pixels disposed in multidimensional, said programcomprising instructions for: a pattern generating step for calculatingnext state to be output from cell of interest to surrounding cells basedon the status input from the surrounding cells and the present state ofthe cell of interest, said cell of interest being selected in turn fromcells corresponding to the pixels of picture each of which having activestate or inactive state according to value of corresponding pixel ofpicture and for calculating next state of the cell of interest based onpresent state of the cell of interest and status input from thesurrounding cells to the cell of interest so that a configurationpattern indicating status of cells in multidimensional is generated andrecorded, wherein the pattern generating means repeats the process ofthe generating and recording the configuration pattern; and a linejudging step for detecting movement of active cell or inactive cellbased on series of the configuration patterns recorded by the patterngenerating step so that the line is judged based on the movement ofcell.
 13. A device for generating a configuration pattern to be used forextracting line segments from a picture having a plurality of pixelsdisposed in multidimensional comprising: pattern generating means forcalculating next state of a cell of interest based on present state ofthe cell of interest and status input from the surrounding cells to thecell of interest, said cell of interest being selected in turn fromcells corresponding to the pixels of picture each of which having activestate or inactive state according to value of corresponding pixel ofpicture so that a configuration pattern indicating status of cells inmultidimensional is generated and recorded, wherein the patterngenerating means repeats the process of the generating and recording theconfiguration pattern; wherein, in said pattern generating meansgenerates the status input from the surrounding cells to the cell ofinterest based on the status input from the surrounding cells and thepresent state of the cell of interest.
 14. Computer-readable mediumstoring a program for generating configuration pattern to be used forextracting line segments from a picture having a plurality of pixelsdisposed in multidimensional, said program comprising instructions for:a pattern generating step for calculating next state of a cell ofinterest based on present state of the cell of interest and status inputfrom the surrounding cells to the cell of interest, said cell ofinterest being selected in turn from cells corresponding to the pixelsof picture each of which having active state or inactive state accordingto value of corresponding pixel of picture so that a configurationpattern indicating status of cells in multidimensional is generated andrecorded, wherein the pattern generating means repeats the process ofthe generating and recording the configuration pattern; wherein, in saidpattern generating step the status input from the surrounding cells tothe cell of interest is generated based on the status input from thesurrounding cells and the present state of the cell of interest.